﻿using System;
using System.Collections.Generic;
using System.Linq;
using context;
using entities;

namespace DataAccessLibrary.DAL
{
    public class ReportDAO
    {
        public List<vIncome> SelectIncomeByDate(DateTime pBookingDateFrom, DateTime pBookingDateTo)
        {
            using (var ctx = new BlueMDataContext())
            {
                var result = ctx.vIncomes.Where(p => p.BookingDate >= pBookingDateFrom && p.BookingDate <= pBookingDateTo).
                        ToList();
                return result;             
            }
        }

        public List<vReportCustomerCheck> ReportCustomerCheck()
        {
            using (var ctx = new BlueMDataContext())
            {
                return ctx.vReportCustomerChecks.ToList();
            }
        }       
    }
}